package com.qyhl.webtv.module_live.teletext.content;


import com.qyhl.webtv.commonlib.entity.live.TeleTextLiveBean;

import java.util.List;

/**
 * Created by qyhl on 2017/7/7.
 */

public class TeleTextLivePresenter implements TeleTextLiveContract.TeleTextLivePresenter {
    private TeleTextLiveContract.TeleTextLiveView mView;
    private TeleTextLiveContract.TeleTextLiveModel mModel;

    public TeleTextLivePresenter(TeleTextLiveContract.TeleTextLiveView mView) {
        this.mView = mView;
        this.mModel = new TeleTextLiveModel(this);
    }

    @Override
    public void getDatas(String sceneId, String contentId, boolean isMore) {
        mModel.getDatas(sceneId, contentId, isMore);
    }

    @Override
    public void setDatas(List<TeleTextLiveBean> beanList, boolean isMore) {
        mView.setDatas(beanList, isMore);
    }

    @Override
    public void setError(int errorId, String msg) {
        if (errorId == 0) {
            mView.setEmpty(msg);
        } else if (errorId > 0) {
            mView.setError(msg);
        } else {
            mView.setNoMore(msg);
        }
    }


    @Override
    public void setNoMore(String msg) {
        mView.setNoMore(msg);
    }


}
